import { PageReq, PageRes } from '@/api/types'
import request from '@/utils/request'

// 获取盘点列表
export function inventoryPageApi(data: PageReq<Partial<any>>) {
  return request<PageRes<any>>({
    url: '/inventory/page',
    method: 'post',
    data
  })
}

// 新增盘点
export function addInventoryApi(data: any) {
  return request({
    url: '/inventory/add',
    method: 'post',
    data
  })
}

// 更新盘点
export function editInventoryApi(data: any) {
  return request({
    url: '/inventory/edit',
    method: 'post',
    data
  })
}

// 删除盘点
export function delInventoryApi(data: { id: number }) {
  return request({
    url: '/inventory/del',
    method: 'post',
    data
  })
}

// 获取盘点列表
export function getInventoryListApi(data: { isUse: boolean; orgId: number }) {
  return request({
    url: '/inventory/getInventoryList',
    method: 'post',
    data
  })
}
inventoryDetailsPageApi

// 获取盘点详情列表
export function inventoryDetailsPageApi(data: PageReq<Partial<any>>) {
  return request<PageRes<any>>({
    url: '/inventory/detailsPage',
    method: 'post',
    data
  })
}

// 盘点
export function inventoryApi(data: any) {
  return request({
    url: '/inventory/inventory',
    method: 'post',
    data
  })
}
// 整单完成
export function inventoryAllApi(data: any) {
  return request({
    url: '/inventory/inventoryAll',
    method: 'post',
    data
  })
}
